home *** CD-ROM | disk | FTP | other *** search
/ PC Player 2004 May / pc player 2004-05.iso / Demos / FarCry / Data1.cab / _D0DB267385224011A62086A0E2CE4F17 < prev    next >
Encoding:
Text File  |  2004-01-06  |  929 b   |  32 lines

  1. // ===============================================================
  2. // Vertex Program: 
  3. // Description: 
  4. // Last Update: 14/08/2003
  5. // Coder: Andrey Honich
  6. // ===============================================================
  7.  
  8.       #include "../CGVPMacro.csi"
  9.  
  10.  
  11.       VertAttributes { POSITION_3 TEXCOORD0_2 TANG_3X3 }
  12.       MainInput { VIEWPROJ_MATRIX, LIGHT_POS }
  13.       DeclarationsScript
  14.       {
  15.         IN_T0_C0_TANG
  16.         OUT_T0_T1
  17.       }
  18.       PositionScript = PosCommon
  19.       CoreScript
  20.       {
  21.         OUT.Tex0.xy = IN.TexCoord0.xy;
  22.  
  23.         TANG_MATR
  24.  
  25.         // compute the 3x3 tranform from tangent space to object space
  26.         // store normalized light vector
  27.         float3 lightVec = LightPos.xyz - vPos.xyz;
  28.         
  29.         // transform light vector from object space to tangent space and pass it as a color
  30.         OUT.Tex1.xyz = mul(objToTangentSpace, lightVec.xyz);
  31.       }
  32.